package com.cskaoyan.wordmemorize.dao.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.cskaoyan.wordmemorize.common.entity.BaseDO;
import lombok.Data;

import java.sql.Timestamp;
import java.time.LocalDate;
import java.util.Objects;

@Data
@TableName("user_voc_rev")
public class UserVocRevDO extends BaseDO {

   /**
    * 词汇ID（关联词汇表）
    */
    Long vocId;

    /**
     * 用户ID（关联用户表）
     */
    Long userId;

    /**
     * 记忆因子（用于计算复习间隔的算法因子）
     */
    Double factor;

    /**
     * 复习间隔（单位：天）
     */
    Integer reviewInterval;

    /**
     * 下次复习日期
     */
    LocalDate nextReviewDate;

    /**
     * 学习状态类型（0: 还未学习, 1: 正常复习）
     */
    Integer type;

    /**
     * 熟悉度等级（0: 不认识, 1: 模糊, 2: 认识, 3: 简单）
     */
    Integer familiarity;

    /**
     * 连续失败次数（连续复习失败计数）
     */
    Integer consecutiveFailCount;

    /**
     * 总复习次数
     */
    Integer totalReview;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserVocRevDO that = (UserVocRevDO) o;
        return Objects.equals(vocId, that.vocId) && Objects.equals(userId, that.userId) && Objects.equals(factor, that.factor) && Objects.equals(reviewInterval, that.reviewInterval) && Objects.equals(nextReviewDate, that.nextReviewDate) && Objects.equals(type, that.type) && Objects.equals(familiarity, that.familiarity) && Objects.equals(consecutiveFailCount, that.consecutiveFailCount) && Objects.equals(totalReview, that.totalReview);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), vocId, userId, factor, reviewInterval, nextReviewDate, type, familiarity, consecutiveFailCount, totalReview);
    }


}
